﻿using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace AJArt.Test
{
    [TestClass]
    public class NormalizeFiles
    {
        [TestMethod]
        [Description("normalize photoes and thunmbnails")]
        public void Normalize()
        {
            const string root = @"C:\Users\miles\Desktop\wenjian\wenjian";
            foreach (var cate in Directory.GetDirectories(root))
            {
                foreach (var story in Directory.GetDirectories(cate))
                {
                    int i = 0;
                    foreach (var photo in Directory.GetFiles(story, "*.jpg"))
                    {
                        var fi = new FileInfo(photo);
                        fi.MoveTo(fi.DirectoryName + @"\" + i++.ToString("00") + ".jpg");
                    }
                }
            }
        }
    }
}
